package com.demo1;

class Student extends Person {
    private String id;
    private double score;

    public Student() {
    }

    public Student(String name, int age, String id, double score) {
        super(name, age);  // 指定调用父类的有参构造器，对父类初始化
        this.id = id;
        this.score = score;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public String say() {  // 方法覆盖
        return super.say() + "\tid：" + this.id + "\tscore：" + this.score;
    }
}
